package main.java.com.epam;

public class Adder implements Runnable {

	private RingBuffer ringBuffer;
	
	public Adder(RingBuffer ringBuffer){
		this.ringBuffer = ringBuffer;
	}
	
	@Override
	public void run() {
		while(true){
				try {
					ringBuffer.insertMessage("potok " + Thread.currentThread().getId() + " zgeneryvav povidomlennya");
					Thread.yield(); 
				} catch (InterruptedException e) {
					e.printStackTrace();
				}			
		}
	}

}
